package com.nervenets.web.controller.user;

import com.nervenets.Global;
import com.nervenets.web.controller.TokenParams;
import com.nervenets.web.enumeration.Gender;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Positive;

@EqualsAndHashCode(callSuper = true)
@Data
public class AddressEditParams extends TokenParams {
    @ApiModelProperty(value = "地址ID，不传或传0时为新建")
    private long addressId;
    @ApiModelProperty(value = "姓名", required = true)
    @NotNull(message = "姓名不能为空")
    private String name;
    @ApiModelProperty(value = "性别", required = true)
    @NotNull(message = "性别不能为空")
    private Gender gender;
    @ApiModelProperty(value = "手机号码", required = true)
    @Pattern(regexp = Global.RegExp.MOBILE, message = "请输入正确的手机号码")
    private String mobile;
    @ApiModelProperty(value = "地区ID", required = true)
    @Positive(message = "请选择正确的地区")
    private int areaId;
    @ApiModelProperty(value = "详情地址描述", required = true)
    @NotNull(message = "详情地址描述不能为空")
    private String detail;
    @ApiModelProperty(value = "是否设置为默认", required = true)
    private boolean def;
    @ApiModelProperty(value = "经度", required = true)
    private double longitude = 0;
    @ApiModelProperty(value = "纬度", required = true)
    private double latitude = 0;
}
